/***********************************************************************************************************************
**                                                                                                                    **
**  FILENAME  : Std_Types.h                                                                                           **
**  AUTHOR    :                                                                                                       **
**  VENDOR    :                                                                                                       **
**  DESCRIPTION: Provision of Standard Types                                                                          **
**  SPECIFICATION(S) :   AUTOSAR classic Platform 4.3.0                                                               **
**                                                                                                                    **
***********************************************************************************************************************/
#ifndef STD_TYPES_H
#define STD_TYPES_H


/***********************************************************************************************************************
**                                               platform types                                                       **
***********************************************************************************************************************/
typedef unsigned char       boolean;
typedef boolean             BOOL;

typedef unsigned char       uint8;       /*           0 .. 255             */
typedef unsigned short      uint16;      /*           0 .. 65535           */
typedef unsigned long       uint32;      /*           0 .. 4294967295      */
typedef unsigned long long  uint64;      /*        0..18446744073709551615 */
typedef signed char         sint8;       /*        -128 .. +127            */
typedef signed short        sint16;      /*      -32768 .. +32767          */
typedef signed long         sint32;      /* -2147483648 .. +2147483647     */
typedef signed long long    sint64; /*-9223372036854775808..9223372036854775807*/

typedef unsigned long       uint8_least;      /* At least 8 bit                 */
typedef unsigned long       uint16_least;     /* At least 16 bit                */
typedef unsigned long       uint32_least;     /* At least 32 bit                */

typedef signed long         sint8_least;        /* At least 7 bit + 1 bit sign    */
typedef signed long         sint16_least;       /* At least 15 bit + 1 bit sign   */
typedef signed long         sint32_least;       /* At least 31 bit + 1 bit sign   */

typedef float               float32;
typedef double              float64;

/***********************************************************************************************************************
**                                               compiler types                                                       **
***********************************************************************************************************************/
#ifndef NULL_PTR
#define NULL_PTR  ((void*)0)
#endif

/***********************************************************************************************************************
**                                               standard types                                                       **
***********************************************************************************************************************/
#define STD_HIGH    0x01u /* Physical state 5V or 3.3V */
#define STD_LOW     0x00u /* Physical state 0V */

#define STD_ACTIVE  0x01u /* Logical state active */
#define STD_IDLE    0x00u /* Logical state idle */

#define STD_ON      0x01u
#define STD_OFF     0x00u

#ifndef TRUE
#define TRUE        1u
#endif

#ifndef FALSE
#define FALSE       0u
#endif


/* This typedef has been added for OSEK compliance */
# ifndef STATUSTYPEDEFINED
#  define STATUSTYPEDEFINED
#  define E_OK      0u
typedef unsigned char StatusType; /* OSEK compliance */
# endif

# define E_NOT_OK   1u

typedef uint8 Std_ReturnType;

typedef struct
{
   uint16 vendorID;
   uint16 moduleID;
   uint8  sw_major_version;
   uint8  sw_minor_version;
   uint8  sw_patch_version;
} Std_VersionInfoType;


#endif /* STD_TYPES_H */
